package band.wukong.practice.springboot.spring4.advanced.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author wukong(wukonggg@139.com)
 */
@Configuration
@ComponentScan("band.wukong.practice.springboot.spring4.advanced.conditional")
public class ShellConfig {

    @Bean
    @Conditional(WindowsCondition.class)
    public ShellService windowsShellService() {
        return new WindowsShellService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public ShellService linuxShellService() {
        return new LinuxShellService();
    }
}
